package vn.sunnet.game.SinhTon.map;

import java.util.ArrayList;

import vn.sunnet.game.SinhTon.global.Assets;

import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.math.Polygon;

public class Map {
	private Texture texture;
	private ArrayList<Polygon> arrPolygon;
	private int id;

	public Map(int id) {
		this.setId(id);
		texture = Assets.ttMap.get(id - 1);
		arrPolygon = new ArrayList<Polygon>();
		switch (id) {
		case 1:
			arrPolygon.add(new Polygon(new float[] { 279, 267, 335, 236, 644,
					426, 729, 426, 729, 342, 800, 342, 692, 480 }));
			break;

		case 2:
			arrPolygon.add(new Polygon(new float[] { 0, 213, 115, 213, 120,
					150, 0, 135 }));
			arrPolygon.add(new Polygon(
					new float[] { 136, 136, 193, 85, 124, 34 }));

			arrPolygon.add(new Polygon(new float[] { 0, 390, 84, 391, 193, 434,
					197, 480 }));
			arrPolygon.add(new Polygon(new float[] { 419, 480, 422, 440, 515,
					390, 800, 398 }));
			break;
		case 3:
			arrPolygon.add(new Polygon(new float[] { 0, 339, 155, 340, 214,
					394, 583, 395, 800, 428, 0, 428 }));
			break;
		case 4:
			arrPolygon.add(new Polygon(new float[] { 192, 480, 107, 252, 155,
					192, 250, 190, 287, 420, 355, 424, 355, 480 }));

			arrPolygon.add(new Polygon(new float[] { 500, 480, 525, 242, 658,
					277, 658, 480 }));
			break;
		
		case 5:
			arrPolygon.add(new Polygon(new float[] { 128, 349, 219, 377, 222,
					440 }));
			arrPolygon.add(new Polygon(new float[] { 364, 240, 467, 253, 418,
					330 }));
			break;
		case 6:
			arrPolygon.add(new Polygon(
					new float[] { 0, 290, 172, 303, 186, 480 }));

			arrPolygon.add(new Polygon(new float[] { 411, 480, 459, 426, 577,
					444, 577, 480 }));
			arrPolygon.add(new Polygon(new float[] { 620, 480, 637, 442, 689,
					480 }));
			arrPolygon.add(new Polygon(new float[] { 800, 418, 733, 392, 736,
					276, 574, 207, 596, 177, 641, 186, 738, 100, 800, 125 }));
			break;
		case 7:
			arrPolygon.add(new Polygon(new float[] { 128, 349, 219, 377, 222,
					440 }));
			arrPolygon.add(new Polygon(new float[] { 80, 480, 130, 409, 182,
					409, 139, 480 }));
			arrPolygon.add(new Polygon(new float[] { 615, 416, 660, 480, 724,
					480, 668, 412 }));
			break;
		
		case 8:
			arrPolygon.add(new Polygon(new float[] { 165, 170, 315, 156, 318,
					262, 260, 290, 331, 408, 47, 390 }));

			arrPolygon.add(new Polygon(new float[] { 605, 290, 650, 400, 552,
					310 }));
			arrPolygon.add(new Polygon(new float[] { 678, 118, 800, 148, 628,
					163 }));
			break;
		case 9:
			arrPolygon.add(new Polygon(new float[] { 228, 333, 228, 175, 54,
					208 }));
			arrPolygon.add(new Polygon(new float[] { 337, 239, 531, 144, 800,
					258 }));
			break;
		case 10:
			arrPolygon.add(new Polygon(new float[] { 547, 480, 549, 448, 666,
					230, 800, 215 }));
			arrPolygon.add(new Polygon(new float[] { 300, 356, 489, 379, 269,
					400 }));
			break;
		}
	}

	public Texture getTexture() {
		return texture;
	}

	public void setTexture(Texture texture) {
		this.texture = texture;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public ArrayList<Polygon> getArrPolygon() {
		return arrPolygon;
	}

	public void setArrPolygon(ArrayList<Polygon> arrPolygon) {
		this.arrPolygon = arrPolygon;
	}
}
